<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.hz.ys_financial.dao.FinancialDao,com.hz.framework.util.*"%><%@page import="com.hz.ys_clientorder.bean.Orderinfo"%><%@page import="com.hz.ys_clientorder.bean.Clientinfo"%><%@page import="java.util.List"%><%@page import="com.hz.ys_clientorder.bean.Taskinfo"%><%@page import="com.hz.ys_stock.bean.PresMakings"%>






<%@ include file="../common/commonJS.jsp" %>
<%@ include file="../common/commonLabel.jsp" %>
                  <%
              		FinancialDao fd = new FinancialDao();
          		request.setAttribute("personlist", fd.SelPerson());//查询人员信息 %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>订单信息修改</title>
</head>
                  <%
                  Orderinfo o = (Orderinfo)request.getAttribute("order");
                  Clientinfo c = (Clientinfo)request.getAttribute("client");
                  List<Taskinfo> tlist = (List<Taskinfo>)request.getAttribute("tlist");
                  List<PresMakings> pm = (List<PresMakings>)request.getAttribute("pm");
               %>
<script type="text/javascript">
var projectAmout = "<%=tlist.size()%>";
var nowStock;
function selectClient(){
	doQueryMess("/pressystem/clientListForOrder.action?operate=inspage","","500","500");
	return false;
}
function selectStock(obj){
	nowStock=obj.parentNode.parentNode.parentNode;
	var source;
	var ips = nowStock.all.tags("SELECT");
	for (var i=0; i<ips.length; i++) {
		if(ips[i].name=="source"){
			source=ips[i].value;
		}
	}
			
	doQueryMess("/pressystem/stockListForTask.action?operate=inspage&source="+source+"","","750","500");
}
function createProject(btn){
	var projectTable = btn.parentNode.parentNode.parentNode.parentNode;
	var bigTd = projectTable.parentNode;
	var newTable = projectTable.cloneNode(true);
	//清空区域内input内容
	var ips = newTable.all.tags("INPUT");
	for (var i=0; i<ips.length; i++) {
		if(ips[i].name!=null&&ips[i].name!=""){
		  	ips[i].value = "";
		}
	}
	bigTd.appendChild(newTable);
	projectAmout++;
}

function delProject(btn){
	var projectTable = btn.parentNode.parentNode.parentNode.parentNode;
	if(projectAmout == 1){
		alert("无法删除，至少要存在一个生产项目");
	}else{
		if(window.confirm("你确定要删除这个生产项目么？")){
			projectTable.parentNode.removeChild(projectTable);
			projectAmout--;
		}
	}

}
function subForm(){
	if(check()){
		document.forms[0].submit();
	}
}
function ctpUnitPlus(ctp){
	//为ctp加单位
	if(ctp.value=='' || ctp.value.length<1){
		ctp.value=0;
		ctp.value=ctp.value+ctp.nextSibling.options[ctp.nextSibling.selectedIndex].innerHTML;
		return false;
	}else{
		if(ctp.value.indexOf('张')!=-1||ctp.value.indexOf('套')!=-1){
			if(ctp.value.lastIndexOf('张')!=-1){
				ctp.value=ctp.value.substring(0,ctp.value.lastIndexOf('张'));
			}else{
				ctp.value=ctp.value.substring(0,ctp.value.lastIndexOf('套'));
			}
			ctp.value=ctp.value+ctp.nextSibling.options[ctp.nextSibling.selectedIndex].innerHTML;
		}else{
			ctp.value=ctp.value+ctp.nextSibling.options[ctp.nextSibling.selectedIndex].innerHTML;
		}
		
	}
	
	
}
function addnum(){
	var paperCost = document.all["o.paperCost"];
	var printCost = document.all["o.printCost"];
	var coverCost = document.all["o.coverCost"];
	var goldCost =  document.all["o.goldCost"];
	var filmCost =  document.all["o.filmCost"];
	var otherCost = document.all["o.otherCost"];
	var total = document.all["o.total"];//总金额
	var frontCash = document.all["o.frontCash"];//预付款
	var debtCash = document.all["o.debtCash"];//欠款
 	var all = 0.0;
		if(trim(paperCost.value)!=""&&!isNaN(trim(paperCost.value))){
			all =  all+new Number(paperCost.value);
	}
		if(trim(printCost.value)!=""&&!isNaN(trim(printCost.value))){
			all =  all+new Number(printCost.value);
	}
		if(trim(coverCost.value)!=""&&!isNaN(trim(coverCost.value))){
			all =  all+new Number(coverCost.value);
	}
		if(trim(goldCost.value)!=""&&!isNaN(trim(goldCost.value))){
			all =  all+new Number(goldCost.value);
	}
		if(trim(filmCost.value)!=""&&!isNaN(trim(filmCost.value))){
			all =  all+new Number(filmCost.value);
	}
		if(trim(otherCost.value)!=""&&!isNaN(trim(otherCost.value))){
			all =  all+new Number(otherCost.value);
	}
		total.value = all.toFixed(2);
		if(trim(frontCash.value)!=""&&!isNaN(trim(frontCash.value))){
			debtCash.value =  (all-new Number(frontCash.value)).toFixed(2);
	}
		
}

function checkSize(obj){
	var nowTable=obj.parentNode.parentNode.parentNode.parentNode;
	var subPaper=0;//减纸
	var turnAmount=0;//转数
	var tprintSize=0;//印刷开数
	var tfinishSize=0;//成品开数
	var taddAmount=0;//加放
	var tamount=0;//成品数量
	var tsingleDouble;
	var ips = nowTable.all.tags("INPUT");
	var sels = nowTable.all.tags("SELECT");
	for (var i=0; i<ips.length; i++) {
		if(ips[i].name=="tsubPaper"){
			subPaper=ips[i];
		}
		if(ips[i].name=="tturnAmount"){
			turnAmount=ips[i];
		}
		if(ips[i].name=="taddAmount"){
			taddAmount=ips[i].value==""?0:ips[i].value;
		}
		if(ips[i].name=="tamount"){
			tamount=ips[i].value==""?0:ips[i].value;
		}
	}
	for (var a=0; a<sels.length; a++) {
		if(sels[a].name=="tprintSize"){
			tprintSize=sels[a];
		}
		if(sels[a].name=="tfinishSize"){
			tfinishSize=sels[a];
		}
		if(sels[a].name=="tsingleDouble"){
			tsingleDouble=sels[a];
		}
	}
	if(tprintSize.options[tprintSize.selectedIndex].value>tfinishSize.options[tfinishSize.selectedIndex].value){
		turnAmount.value="尺寸选择有误";
		return false;
	}
	//减纸  (成品数量/成品开数 )+（加放/印刷尺寸）
	subPaper.value=(new Number(tamount)/new Number(tfinishSize.options[tfinishSize.selectedIndex].value))+((new Number(taddAmount)/tprintSize.options[tprintSize.selectedIndex].value));
	
	//转数 =成品数量/（成品开数/印刷开数）
	turnAmount.value=new Number(tamount)/(Math.floor(tfinishSize.options[tfinishSize.selectedIndex].value/tprintSize.options[tprintSize.selectedIndex].value));
	//turnAmount.value=(new Number(tamount)+new Number(taddAmount))/new Number(tprintSize.options[tprintSize.selectedIndex].value) * new Number(tsingleDouble.options[tsingleDouble.selectedIndex].value);
	
	//如果有小数+1
	if(subPaper.value%1!=0){
		subPaper.value = round((subPaper.value - (subPaper.value%1) + 1),2);
	}
	if(turnAmount.value%1!=0){
		turnAmount.value = round((turnAmount.value - (turnAmount.value%1) + 1),2);
	}
}
</script>
<body>
<form action="orderUpd.action" method="post">
<table width="760" border="0" cellpadding="0" cellspacing="0" >
  <tr>
     <td>
     <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" class="MainBody" id="111">
      <tr>
        <td class="MainBody_title">订单资料</td>
      </tr>
        <tr>
          <td valign="top" >
          <div align="right" style="padding: 10 50 10 0;">
          <input type="button" onclick="subForm()" value="保 存" class="btn" />&nbsp;&nbsp;&nbsp;&nbsp;
          <input type="button" onclick="window.location.href='<%=request.getContextPath()+"/docs/ys_clientorder/orderList.action" %>'" value="返 回" class="btn" />
          <input type="hidden" name="o.id" value="<%=o.getId() %>">
          <input type="hidden" name="o.orderId" value="<%=o.getOrderId() %>">
          </div>
          <table  border="0" cellpadding="0" cellspacing="0" class="MainBody_table">
                <tr>
                  <td  colspan="4" class="bg_title">客 户 信 息</td>
                </tr>
                <tr>
                  <th width="150px;"  nowrap="nowrap">客户姓名</th>
                  <td width="200px;" style="text-align: left;">
                  <input class="notnull" check="checkBlank" title="客户姓名" id="clientName" value="<%=c.getClientName()%>" readonly="readonly" onclick="return selectClient()"/>
                  <input id="clientId" name="o.clientId" value="<%=o.getClientId() %>" type="hidden"/>
                  </td>
                   <th width="150"  nowrap="nowrap">单位名称</th>
                  <td width="200px;" ><input id="unitName" type="text" value="<%=c.getUnitName()%>" class="readinput" size="10" readonly="readonly" maxlength="50"/></td>
                </tr>
                
                <tr>
                  <th nowrap="nowrap">移动电话</th>
                  <td ><input id="phone" type="text" size="20" value="<%=c.getPhone()%>" class="readinput" readonly="readonly" maxlength="20" /></td>
                  <th nowrap="nowrap">固定电话</th> 
                  <td ><input id="tel" type="text" size="20" value="<%=c.getTel() %>" class="readinput" readonly="readonly" maxlength="20"/></td>
                </tr>
              
               <tr>
                  <th nowrap="nowrap">其他联系人</th>
                  <td ><input name="o.otherClient" type="text" title="其他联系人" value="<%=o.getOtherClient()%>" size="20" maxlength="20" /></td>
                  <th nowrap="nowrap">其他联系方式</th> 
                  <td ><input name="o.otherTel" type="text" title="其他联系方式" value="<%=o.getOtherTel()%>" size="20" maxlength="20"/></td>
                  
                </tr>
                <tr>
                  <th nowrap="nowrap">送货地址<br/>(不填默认客户地址)</th>
                  <td ><input name="o.otherAddress" value="<%=o.getOtherAddress() %>" title="送货地址" type="text" size="20" maxlength="20" /></td>
                  <th nowrap="nowrap">提货方式</th> 
                  <td style="text-align: left;">
                  <select name="o.carryType" title="提货方式">
                  </select></td>
                  
                </tr>
                 <tr>
                  <td  colspan="4" class="bg_title">订 单 详 情</td>
                </tr>
                <tr>
                  <th nowrap="nowrap">订单名称</th>
                  <td ><input name="o.name" value="<%=o.getName()%>" type="text" class="notnull" check="checkBlank" title="订单名称" id="clientName" size="20" maxlength="20" /></td>
                  
                 
                  <th nowrap="nowrap">订单类型</th> 
                  <td style="text-align: left;">
                  <select name="o.orderType" >
                  <option>请选择</option>
                  </select>
                  </td>
                </tr>
                
                   <tr>
                  <th nowrap="nowrap">下单日期</th>
                  <td ><input name="o.orderTime" type="text" title="下单日期" readonly="readonly" value="<%=o.getOrderTime() %>"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})" class="Wdate" size="20" maxlength="20" /></td>
              <th nowrap="nowrap">印品种类</th>
                  <td style="text-align: left;">
                  <select name="o.goodsType" >
                  <option>请选择</option>
                  </select>
                  </td>
                </tr>
                
                   <tr>
                   
                  <th nowrap="nowrap">交货日期</th> 
                  <td ><input name="o.finishTime" value="<%=o.getFinishTime()%>" type="text" title="交货日期" check="checkBlank" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})" class="Wdate" size="20" maxlength="20"/></td>
                 <th nowrap="nowrap">是否代收</th>
                 <td style="text-align: left;">
                  <select name="o.isCollection" >
                  <option>请选择</option>
                  </select>
                  </td>
                </tr>
                
                   <tr>
                  <th nowrap="nowrap">结账日期</th> 
                  <td ><input name="o.balanceTime" value="<%=o.getBalanceTime() %>" type="text" size="20"  title="结账日期" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})" class="Wdate" maxlength="20"/></td>
                  <th nowrap="nowrap">设计人</th>
                  <td  style="text-align: left;"><%=o.getDesigner() %></td>
                </tr>
                
              
                   <tr>
                  <td  colspan="4" class="bg_title">工 艺 详 情</td>
                </tr>
                
                  <tr>
                    <th nowrap="nowrap">印品说明</th>
                  <td colspan="3" style="text-align: left;"><textarea name="o.caption" cols="65" rows="2"><%=o.getCaption() %></textarea></td>
                 </tr>
                 
                  <tr>
                    <th nowrap="nowrap">设计制作要求</th>
                  <td><textarea name="o.designRequest" ><%=o.getDesignRequest() %></textarea></td>
                    <th nowrap="nowrap">印刷工艺要求</th>
                  <td><textarea name="o.technologyRequest" ><%=o.getTechnologyRequest() %></textarea></td>
                 </tr>
                  <tr>
                    <th nowrap="nowrap">拼晒要求</th>
                  <td><textarea name="o.buleRequest" ><%=o.getBuleRequest() %></textarea></td>
                    <th nowrap="nowrap">质检要求</th>
                  <td><textarea name="o.qualityRequest" ><%=o.getQualityRequest() %></textarea></td>
                 </tr>
                     <tr>
                    <th nowrap="nowrap">印后要求</th>
                  <td><textarea name="o.finishRequest" ><%=o.getFinishRequest() %></textarea></td>
                    <th nowrap="nowrap">送货包装要求</th>
                  <td><textarea name="o.packageRequest" ><%=o.getPackageRequest() %></textarea></td>
                 </tr>
                     <tr>
                    <th nowrap="nowrap">客户提供</th>
                  <td><textarea name="o.clientOffer" ><%=o.getClientOffer() %></textarea></td>
                    <th nowrap="nowrap">外协内容</th>
                  <td><textarea name="o.consultContent" ><%=o.getConsultContent() %></textarea></td>
                 </tr>
                  <!--<tr>
                    <th nowrap="nowrap">图片</th>
                  <td colspan="3" style="text-align: left;"><input type="file" name="o.image"/></td>
                 </tr>-->
                 <tr>
                    <th nowrap="nowrap">备注</th>
                  <td colspan="3" style="text-align: left;"><textarea name="o.description" cols="65" rows="2"><%=o.getDescription() %></textarea></td>
                 </tr>
                    <tr>
                  <td  colspan="4" class="bg_title">财 务 情 况</td>
                </tr>
                 <tr>
                  <th nowrap="nowrap" width="150px;">纸费</th>
                  <td width="200px;"><input name="o.paperCost" value="<%=o.getPaperCost() %>" type="text" class="notnull" title="纸费" check="checkBlank,checkNaN"  size="20" maxlength="20" onblur="addnum()" /></td>
                  <th nowrap="nowrap" width="150px;">印刷费</th> 
                  <td width="200px;"><input name="o.printCost" type="text" value="<%=o.getPrintCost() %>" class="notnull" check="checkBlank,checkNaN" title="印刷费" size="20" maxlength="20" onblur="addnum()"/></td>
                  
                  
                </tr>
                
                <tr>
                  <th nowrap="nowrap">覆膜费</th>
                  <td ><input name="o.coverCost" type="text" value="<%=o.getCoverCost() %>" check="checkNaN" title="覆膜费" size="20" maxlength="20" onblur="addnum()"/></td>
                  <th nowrap="nowrap">烫金费</th> 
                  <td ><input name="o.goldCost" type="text" value="<%=o.getGoldCost() %>" check="checkNaN" title="烫金费" size="20" maxlength="20" onblur="addnum()"/></td>
                </tr>
                
                <tr>
                  <th nowrap="nowrap">菲林费</th>
                  <td ><input name="o.filmCost" type="text" value="<%=o.getFilmCost() %>" check="checkNaN" title="菲林费" size="20" maxlength="20" onblur="addnum()"/></td>
                  
                  <th nowrap="nowrap">CTP费</th> 
                  <td ><input name="o.otherCost" type="text" value="<%=o.getOtherCost() %>" check="checkNaN" title="CTP费" size="20" maxlength="20" onblur="addnum()"/></td>
                  
                </tr>
                
                <tr>
                  <th nowrap="nowrap">总金额</th>
                  <td ><input name="o.total" type="text" value="<%=o.getTotal() %>" class="notnull" check="checkBlank,checkNaN" title="总金额"  size="20" maxlength="20" /></td>
                  <th nowrap="nowrap">单价</th> 
                  <td ><input name="o.price" type="text" value="<%=o.getPrice() %>" check="checkNaN" title="单价"  size="20" maxlength="20"/></td>
                </tr>
                
                <tr>
                  <th nowrap="nowrap">预付款</th>
                  <td ><input name="o.frontCash"  class="notnull" value="<%=o.getFrontCash() %>" check="checkBlank,checkNaN" title="预付款" type="text" size="20" maxlength="20" onblur="addnum()"/></td>
                  <th nowrap="nowrap">付款方式</th> 
                  <td style="text-align: left;">
                  <select name="o.payType" >
                  <option>请选择</option>
                  </select>
                  </td>
                </tr>
                
                <tr>
                  <th nowrap="nowrap">欠款</th>
                  <td ><input name="o.debtCash" value="<%=o.getDebtCash() %>" type="text"  class="notnull" check="checkBlank,checkNaN" title="欠款" size="20" maxlength="20" /></td>
                  <th nowrap="nowrap">纯利润</th> 
                  <td ><input name="o.profitCash" value="<%=o.getProfitCash() %>" type="text" size="20" maxlength="20"/></td>
                </tr>
                 <tr>
                  <td  colspan="4" class="bg_title">其 他 信 息</td>
                </tr>
                <tr>
                  <th nowrap="nowrap">特别提示</th>
                  <td ><input name="o.special" value="<%=o.getSpecial() %>" type="text" size="20" maxlength="20" /></td>
                  <th nowrap="nowrap">下单人</th> 
                  <td >
                  <%=o.getCreator() %>
                  </td>
                </tr>
                 <tr>
                  <td  colspan="4" class="bg_title" nowrap="nowrap" height="30px;">生 产 情 况
                  </td>
                </tr>
                </table>
                <%	
                String tturnOver ="";
                String tcut ="";
                String tcover ="";
                	if(!tlist.isEmpty()){
                	for(Taskinfo t : tlist){
                		tturnOver += t.getTurnOver()+",";
                		tcut += t.getCut()+",";
                		tcover += t.getCover()+",";
	                	PresMakings p = null;
	                	for(PresMakings m : pm){
	                		if(t.getGoodsid().equals(m.getGoodsid())){
	                			p=m;
	                			break;
	                		}
	                	}
                	
                	 
                %>	
                <table  border="0" cellpadding="0" cellspacing="0" class="MainBody_table" id="t1">
                  <tr>
                  <td colspan="4" style="text-align: right; " >
                  
                  <input type="button" class="btn" value="添加项目" onclick="createProject(this)"/>
                  </td>
                  </tr>
                  <tr>
                  <th nowrap="nowrap" width="150px;">印品名称</th>
                  <td width="200px;"><input name="ttaskName" value="<%=t.getTaskName()%>" check="checkBlank" class="notnull" title="印品名称" type="text" size="20" maxlength="20" /></td>
                   <th>
                   </th>
                   <td>
                   </td>
                </tr>
                
                 <tr>
                 <th nowrap="nowrap">原料名称</th>
                  <td >
                  <input type="text" readonly="readonly" title="原料名称" value="<%=p.getGoodsname() %>" check="checkBlank" name="goodsname" onclick="return selectStock(this);" onfocus="return selectStock(this);" class="notnull" size="20" maxlength="20"/>
                  <input type="hidden" value="<%=t.getGoodsid()%>" name="tgoodsid"/>
                  <input type="hidden" name="tid" value="<%=t.getId() %>"/>
                  </td>
                  <th nowrap="nowrap">原料种类</th> 
                  <td ><input type="text" readonly="readonly" value="<%=p.getGoodstype() %>" title="原料种类" name="goodstype" size="20"  class="readinput" maxlength="20"/></td>
                  </tr>
                 <tr>
                  <th nowrap="nowrap">原料规格</th>
                  <td ><input type="text" readonly="readonly" title="原料规格" value="<%=p.getStandard() %>" name="goodsstandard" size="20"  class="readinput" maxlength="20" /></td>
                  <th nowrap="nowrap">原料当前库存</th> 
                  <td ><input type="text" readonly="readonly" title="原料当前库存"  size="20" name="numreal"  class="readinput" maxlength="20"/></td>
                </tr>
                <tr>
                  <th nowrap="nowrap">印刷尺寸</th>
                  <td width="200px;" style="text-align: left;">
                  <select name="tprintSizeType">
                  <option <%=t.getPrintSizeType().equals("正度")?"selected":"" %>>正度</option>
                  <option <%=t.getPrintSizeType().equals("大度")?"selected":"" %>>大度</option>
                  </select>
                  <select name="tprintSize" onchange="checkSize(this)">
                  <option value="1"  <%=t.getPrintSize().equals("1")?"selected":"" %>>全开</option>
                  <option value="2"  <%=t.getPrintSize().equals("2")?"selected":"" %>>对开</option>
                  <option value="3"  <%=t.getPrintSize().equals("3")?"selected":"" %>>3开</option>
                  <option value="4"  <%=t.getPrintSize().equals("4")?"selected":"" %>>4开</option>
                  <option value="6"  <%=t.getPrintSize().equals("6")?"selected":"" %>>6开</option>
                  <option value="8"  <%=t.getPrintSize().equals("8")?"selected":"" %>>8开</option>
                  <option value="9"  <%=t.getPrintSize().equals("9")?"selected":"" %>>9开</option>
                  <option value="16" <%=t.getPrintSize().equals("16")?"selected":"" %>>16开</option>
                  <option value="32" <%=t.getPrintSize().equals("32")?"selected":"" %>>32开</option>
                  <option value="64" <%=t.getPrintSize().equals("64")?"selected":"" %>>64开</option>
                  <option value="72" <%=t.getPrintSize().equals("72")?"selected":"" %>>72开</option>
                  </select>
                  </td>
                  <th nowrap="nowrap">成品尺寸</th> 
                  <td width="200px;" style="text-align: left;">
                  <select name="tfinishSizeType">
                  <option <%=t.getFinishSizeType().equals("正度")?"selected":"" %>>正度</option>
                  <option <%=t.getFinishSizeType().equals("大度")?"selected":"" %>>大度</option>
                  </select>
                  <select name="tfinishSize" onchange="checkSize(this)">
            	  <option value="1"  <%=t.getFinishSize().equals("1")?"selected":"" %>>全开</option>
                  <option value="2"  <%=t.getFinishSize().equals("2")?"selected":"" %>>对开</option>
                  <option value="3"  <%=t.getFinishSize().equals("3")?"selected":"" %>>3开</option>
                  <option value="4"  <%=t.getFinishSize().equals("4")?"selected":"" %>>4开</option>
                  <option value="6"  <%=t.getFinishSize().equals("6")?"selected":"" %>>6开</option>
                  <option value="8"  <%=t.getFinishSize().equals("8")?"selected":"" %>>8开</option>
                  <option value="9"  <%=t.getFinishSize().equals("9")?"selected":"" %>>9开</option>
                  <option value="16" <%=t.getFinishSize().equals("16")?"selected":"" %>>16开</option>
                  <option value="32" <%=t.getFinishSize().equals("32")?"selected":"" %>>32开</option>
                  <option value="64" <%=t.getFinishSize().equals("64")?"selected":"" %>>64开</option>
                  <option value="72" <%=t.getFinishSize().equals("72")?"selected":"" %>>72开</option>
                  </select>
                  </td>
                </tr>
                 <tr>
                  <th nowrap="nowrap">成品数量</th>
                  <td ><input type="text" name="tamount" class="notnull" value="<%=t.getAmount() %>" title="成品数量" check="checkBlank" onblur="checkSize(this)"  size="20" maxlength="20" /></td>
                  <th nowrap="nowrap">加放数量</th> 
                  <td ><input type="text" name="taddAmount" class="notnull" value="<%=t.getAddAmount() %>" title="加放数量" check="checkBlank" onblur="checkSize(this)"  size="20" maxlength="20"/></td>
                </tr>
                   <tr>
                  <th nowrap="nowrap">转数</th>
                  <td ><input type="text" name="tturnAmount" value="<%=t.getTurnAmount() %>" class="readinput" readonly="readonly"  size="20" maxlength="20" /></td>
                  <th nowrap="nowrap">减纸库</th> 
                  <td ><input type="text" name="tsubPaper" value="<%=t.getSubPaper() %>" class="readinput"  size="20" maxlength="20"/></td>
                </tr>
                 <tr>
                  <th nowrap="nowrap">是否自带纸</th>
                   <td style="text-align: left;" >
                  <select name="tselfPaper">
                  <option value='0' <%=t.getSelfPaper().equals("0")?"selected":"" %>>否</option>
                  <option value='1' <%=t.getSelfPaper().equals("1")?"selected":"" %>>是</option>
                  </select>
                  </td>
                  <th nowrap="nowrap">CTP</th> 
                  <td align="left"><input type="text" name="tctp" size="15" title="CTP数量" class="notnull" onblur="ctpUnitPlus(this)" check="checkBlank" style="width: 120px;" value="<%=t.getCtp() %>" maxlength="15"/><select id='ctpUnit' onchange="ctpUnitPlus(this.previousSibling )"><option>张</option><option>套</option></select></td>
                </tr>
                <tr>
                  <th nowrap="nowrap">单面双面</th>
                  <td style="text-align: left;" >
                  <select name="tsingleDouble" onchange="checkSize(this)">
                  <option value='1' <%=t.getSingleDouble().equals("1")?"selected":"" %>>单面</option>
                  <option value='2' <%=t.getSingleDouble().equals("2")?"selected":"" %>>双面</option>
                  </select>
                  </td>
                  <th nowrap="nowrap">印刷翻法</th> 
                  <td style="text-align: left;" >
                  <select name="tturnOver">
                  <option>请选择</option>
                  </select>
                  </td>
                </tr>
                 <tr>
                  <th nowrap="nowrap">切刀工艺</th>
                  <td style="text-align: left;" >
                  <select name="tcut">
                  <option>请选择</option>
                  </select>
                  </td>
                  <th nowrap="nowrap">覆膜工艺</th> 
                  <td style="text-align: left;" >
                  <select name="tcover">
                  <option>请选择</option>
                  </select>
                  </td>
                </tr>
                <tr>
                 <th nowrap="nowrap">备注</th>
                  <td colspan="3" style="text-align: left;"><textarea name="tdescription" cols="65" rows="2"></textarea></td>
                 </tr>
                 <tr>
                 <td colspan="4" style="text-align: right;"><input type="button" onclick="delProject(this)" class="btn" value="删除项目"/></td>
                 </tr>
                 </table>
                  <%}} %>
          </table></td>
  </tr>
</table>
<script type="text/javascript">
var ttobj = document.all["tturnOver"];
var tcobj = document.all["tcut"];
var tvobj = document.all["tcover"];
var ttv = '<%=tturnOver %>';
var ttvs = ttv.split(",");

var ttc = '<%=tcut %>';
var ttcs = ttc.split(",");

var tto = '<%=tcover %>';
var ttos = tto.split(",");

if(ttobj.length>1){
	for(var i=0;i<ttobj.length;i++){
		doSelectInfo(ttobj[i],'printover',ttvs[i],false);
		doSelectInfo(tcobj[i],'cut',ttcs[i],false);
		doSelectInfo(tvobj[i],'cover',ttos[i],false);
	}
}else{
	doSelectInfo(ttobj,'printover',ttvs[0],false);
	doSelectInfo(tcobj,'cut',ttcs[0],false);
	doSelectInfo(tvobj,'cover',ttos[0],false);
}

doSelectInfo(document.all["o.goodsType"],'ordergoodstype','<%=o.getGoodsType()%>',true);
doSelectInfo(document.all["o.orderType"],'orderType','<%=o.getOrderType() %>',true);
doSelectInfo(document.all["o.carryType"],'carryType','<%=o.getCarryType() %>',false);
doSelectInfo(document.all["o.isCollection"],'trueorfalse','<%=o.getFinishTime() %>',false);

</script>
</form>
</body>
</html>